/*
 * Copyright (c) Shenzhen 7th Road Technical Co., Ltd
 * Technical Support dept.
 * http://www.7road.com
 */
package com.sz7thrd.ts.core.taskmanager;

import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * @author able
 * @date 2011-11-9
 * ===============================
 * 
 * 
 */
public abstract class AbstractLockManager {

	private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
	private final ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock();
	private final ReentrantReadWriteLock.ReadLock readLock = lock.readLock(); // Later could be used.

	public final void writeLock() {
		writeLock.lock();
	}

	public final void writeUnlock() {
		writeLock.unlock();
	}

	public final void readLock() {
		readLock.lock();
	}

	public final void readUnlock() {
		readLock.unlock();
	}
}